 <?php
/**
 * 金币排行榜
 * MoneyRankList
 */
class MoneyRankList extends APIBase {
		
		public $tag = "MoneyRankList";
		public $isLogin = false;
		
		public function before() {
			$this->initCacheRedis();
			return true;
		}

		public function logic() {
			
			for ($i=0; $i< 30; $i++) 
			{
				$rank = $this->cache_redis->hMGet("hMoneyRank:{$i}", array("num","uid", "name", "sex","money","avater_url","signature", "is_vip","total_money"));
				$rank["money"] = (int)$rank["money"];
				$rank["isvip"] = (int)$rank["is_vip"];
				$rank["avater_url"] = (int)$rank["avater_url"];
				$rank["signature"] = $rank["signature"]?$rank["signature"]:'';
				$rank["uid"] = (int)$rank["uid"];
				$rank["sex"] = (int)$rank["sex"];
				$rank["num"] = (int)$rank["num"];
				$rank["total_money"] = (int)$rank["total_money"];
				$ranks[] = $rank;
			}
			$this->returnData(array('ranks' => $ranks));
		}
		
    	public function after() {
			$this->deinitCacheRedis();
		}
    }
?>
